<!DOCTYPE html>
<html>
<head>
	<title>艾特风免费设计</title>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">



	<link rel="stylesheet" href="__CDN__/weui/weui.min.css">
	<link rel="stylesheet" href="__CDN__/weui/jquery-weui.min.css">
	<link rel="stylesheet" href="__CSS__/demos.css">


</head>

<body ontouchstart>

<base href="{:config('site_url')}" />
<header class='demos-header' style="text-align: center">
	<h1 class="demos-title">艾特风免费设计</h1>
	<div class="weui-cells__title">艾特风净化新风系统解决方案</div>
</header>

<form action="{:url('atf/atf')}" id="renovation" method="post">
	<div class="weui-cell ">
		<div class="weui-cell__hd">
			<label class="weui-label">手机号*</label>
		</div>
		<div class="weui-cell__bd">
			<input class="weui-input" type="tel" name="tel" id="tel" placeholder="请输入手机号(必填)">
		</div>
	</div>

<div class="weui-cell">
	<div class="weui-cell__hd"><label class="weui-label">地址*</label></div>
	<div class="weui-cell__bd">
		<input class="weui-input" type="text" name="addr" id="addr" placeholder="地址(必填)">
	</div>
</div>
<div class="weui-cell">
	<div class="weui-cell__hd"><label class="weui-label">姓名*</label></div>
	<div class="weui-cell__bd">
		<input class="weui-input" type="text" id="name" name="name" placeholder="请输入姓名(必填)">
	</div>
</div>
	<div class="weui-cell">
		<div class="weui-cell__hd"><label class="weui-label">微信号</label></div>
		<div class="weui-cell__bd">
			<input class="weui-input" type="text" name="wxid" id="wxid" placeholder="微信">
		</div>
	</div>
	<div class="weui-cell">
		<div class="weui-cell__hd">
			<label for="" class="weui-label">房屋样式</label>
		</div>
		<div class="weui-cell__bd">
				<label><input name="home_style" type="radio" value="平层" />平层 </label>
				<label><input name="home_style" type="radio" value="loft/复式/跃层" />loft/复式/跃层 </label>
				<label><input name="home_style" type="radio" value="别墅/排屋" />别墅/排屋 </label>
		</div>
	</div>
	<div class="weui-cell">
	<div class="weui-cell__hd">
		<label for="" class="weui-label">房屋状态</label>
	</div>
	<div class="weui-cell__bd">
		<label><input name="home_type" type="radio" value="未装修" />未装修 </label>
		<label><input name="home_type" type="radio" value="已装修"/>已装修 </label>
	</div>
</div>

<div class="weui-btn-area">
	<input id="submit"  type="button" value="提交"   class="weui-btn weui-btn_primary"/>
</div>
</form>
<script src="__CDN__/jquery/2.1.4/jquery-2.1.4.js"></script>
<script src="__CDN__/weui/jquery-weui.min.js"></script>
<script type="text/javascript" src="__JS__/public.js"></script>

<script>


	$('#submit').click(function () {


		var $phone = $('#tel');
		if(!$phone.val()||isNaN($phone.val())||$phone.val().length != 11){
			$.toast("输入11位手机号", "cancel");
		}else if(!$('#name').val()||!$('#addr').val()){
			$.toast("请完成表单", "cancel");
		}else{

			var body  ={
				name:$('#name').val(),
				tel:$phone.val(),
				wxid:$('#wxid').val(),
				home_style:$("input[name='home_style']:checked").val(),
				home_type:$("input[name='home_type']:checked").val(),
				addr:$('#addr').val(),

			};
			var $this = $(this);
			ajax_post(getBaseUrl()+'/weixin/atf/atf',jQuery.param(body),{
				success:function(data){
					$.toptip(data.msg, 'success');

				},
				error:function(data){
					$.toptip(data.msg, 'error');
				}
			})
		}

	})
</script>
</body>
</html>